package com.java.reflect;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class TestReadComment {
	public static void main(String[] args) throws IOException {

		FileReader fl = new FileReader("D:\\project_test\\src\\TestHelloWorld.java");// File name
		BufferedReader bf = new BufferedReader(fl);

		List<String> list = new ArrayList<String>();

		String context = null;

		boolean start=false;
		do {
			context = bf.readLine();

			if (context == null) {
				break;
			}

			if (context.trim().startsWith("//")) {
				list.add(context.trim());
				continue;
			}
			
			if(!start){
				if (context.trim().startsWith("/**")) {
					start=true;
					list.add(context.trim());
				}
			}else{
				list.add(context.trim());
				if (context.trim().endsWith("*/")) {
					break;
				}
			}
		} while (context != null);

		for (String item : list) {
			System.out.println(item);
		}
	}
}
